package com.newtouch.cq.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Alex
 * @Description 配置分页插件
 * @time 2021年07月27日 15:24:00
 */
@Configuration
@MapperScan("com.newtouch.cq.**.mapper")
public class MybatisPlusConfig {
    /**
     * 添加mybatis-plus分页插件
     * @return
     */
    @Bean
    public MybatisPlusInterceptor pageInnerInterceptor() {
        MybatisPlusInterceptor paginationInnerInterceptor = new MybatisPlusInterceptor();
        paginationInnerInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return paginationInnerInterceptor;
    }

}
